/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2013.09.30                                          *
 *                                                                       *
 *************************************************************************/

namespace FreeMAPs
{

inline MeshType
MeshInfo::get_mesh_type() const
{
    return d_mesh_type;
}


inline void
MeshInfo::set_mesh_type(const MeshType mesh_type)
{
    d_mesh_type = mesh_type;
}


inline bool
MeshInfo::use_structured_mesh() const
{
    return (d_mesh_type == MeshType::STRUCTURED_MESH || d_mesh_type == MeshType::HYBRID_MESH);
}


inline bool
MeshInfo::use_unstructured_mesh() const
{
    return (d_mesh_type == MeshType::UNSTRUCTURED_MESH || d_mesh_type == MeshType::HYBRID_MESH);
}


inline const StructuredMeshInfo*
MeshInfo::get_structured_mesh_info() const
{
    FREEMAPS_ASSERT (this->use_structured_mesh());
    FREEMAPS_ASSERT_VALID_POINTER (d_structured_mesh_info);

    return d_structured_mesh_info;
}


inline StructuredMeshInfo*
MeshInfo::get_structured_mesh_info()
{
    FREEMAPS_ASSERT (this->use_structured_mesh());
    FREEMAPS_ASSERT_VALID_POINTER (d_structured_mesh_info);

    return d_structured_mesh_info;
}


inline const UnstructuredMeshInfo*
MeshInfo::get_unstructured_mesh_info() const
{
    FREEMAPS_ASSERT (this->use_unstructured_mesh());
    FREEMAPS_ASSERT_VALID_POINTER (d_unstructured_mesh_info);

    return d_unstructured_mesh_info;
}


inline UnstructuredMeshInfo*
MeshInfo::get_unstructured_mesh_info()
{
    FREEMAPS_ASSERT (this->use_unstructured_mesh());
    FREEMAPS_ASSERT_VALID_POINTER (d_unstructured_mesh_info);

    return d_unstructured_mesh_info;
}

}
